package mamikeji.liaowa.ui.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.PagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class MainFragmentAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> mList = new ArrayList<Fragment>();
    private Context context;
    private List<String> mCirclesEntityList = new ArrayList<>();

    public MainFragmentAdapter(Context context , FragmentManager fm, List<Fragment> list , List<String> circlesEntityList) {
        super(fm);
        this.context = context;
        this.mList = list;
        this.mCirclesEntityList = circlesEntityList;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList != null ? mList.size() : 0;
    }

    @Override
    public int getItemPosition(Object object) {
        // TODO Auto-generated method stub
        return PagerAdapter.POSITION_NONE;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mCirclesEntityList.get(position);
    }

}
